Skip to content

Fix autosave thread compression TLS crash.#1544

Merged
codeHusky merged 1 commit intoMCLCE:mainfrom
ModMaker101:fix/compression-tls-thread-crash
Apr 26, 2026
Merged

Fix autosave thread compression TLS crash.#1544
codeHusky merged 1 commit intoMCLCE:mainfrom
ModMaker101:fix/compression-tls-thread-crash

Conversation

@ModMaker101
Copy link
Copy Markdown
Contributor

Description

Fixes a crash in ConsoleSaveFileOriginal::Flush when autosavfe runs on a worker thread with uninitialized Compression TLS.

Changes

Previous Behavior

Server crashes with a read access violation. tls pointer is nullptr in Compression::getCompression because the thread storage slot was never initialized on the save worker thread.

Root Cause

std::thread at ConsoleSaveFileOriginal calls Compression::getCompression without first initializing TLS.

New Behavior

Autosave completes without crashing. Worker thread now properly sets up TLS before calls.

Fix Implementation

Added Compression::UseDefaultThreadStorage at the start of the lambda before any compression calls.

AI Use Disclosure

None.

Related Issues

Side-note

This only happened in Debug mode to my knowledge. I was just getting annoyed with it crashing on me.

@codeHusky codeHusky merged commit e5351b5 into MCLCE:main Apr 26, 2026
1 check passed
itsRevela pushed a commit to itsRevela/LCE-Revelations that referenced this pull request Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants